<template>
  <div class="forum-registration">
    <div class="page-header">
      <div class="container">
        <div class="breadcrumb">
          <el-breadcrumb separator="/">
            <el-breadcrumb-item @click="$router.push('/activities')">活动中心</el-breadcrumb-item>
            <el-breadcrumb-item>论坛报名</el-breadcrumb-item>
          </el-breadcrumb>
        </div>
        <h1 class="page-title">论坛报名</h1>
        <p class="page-subtitle">参与行业高端论坛，共话技术发展趋势</p>
      </div>
    </div>
    
    <div class="container">
      <!-- 论坛信息 -->
      <section class="forum-info-section" v-if="selectedForum">
        <div class="forum-card">
          <div class="forum-image">
            <img :src="selectedForum.image" :alt="selectedForum.title">
            <div class="forum-level-badge">{{ selectedForum.level }}</div>
          </div>
          <div class="forum-details">
            <h2>{{ selectedForum.title }}</h2>
            <p class="forum-description">{{ selectedForum.description }}</p>
            <div class="forum-meta">
              <div class="meta-item">
                <el-icon><Clock /></el-icon>
                <span>{{ selectedForum.time }}</span>
              </div>
              <div class="meta-item">
                <el-icon><Location /></el-icon>
                <span>{{ selectedForum.location }}</span>
              </div>
              <div class="meta-item">
                <el-icon><User /></el-icon>
                <span>限额 {{ selectedForum.capacity }} 人</span>
              </div>
              <div class="meta-item">
                <el-icon><Tickets /></el-icon>
                <span>已报名 {{ selectedForum.registered }} 人</span>
              </div>
            </div>
            <div class="forum-agenda" v-if="selectedForum.agenda">
              <h4>论坛议程</h4>
              <div class="agenda-list">
                <div class="agenda-item" v-for="item in selectedForum.agenda" :key="item.time">
                  <div class="agenda-time">{{ item.time }}</div>
                  <div class="agenda-content">
                    <h5>{{ item.topic }}</h5>
                    <p v-if="item.speaker">演讲嘉宾：{{ item.speaker }}</p>
                  </div>
                </div>
              </div>
            </div>
            <div class="forum-participants" v-if="selectedForum.participants">
              <h4>参与嘉宾</h4>
              <div class="participants-list">
                <span v-for="participant in selectedForum.participants" :key="participant" class="participant-tag">
                  {{ participant }}
                </span>
              </div>
            </div>
          </div>
        </div>
      </section>

      <!-- 报名表单 -->
      <section class="registration-form-section">
        <h2 class="section-title">报名信息</h2>
        <div class="form-container">
          <el-form :model="registrationForm" :rules="registrationRules" ref="registrationFormRef" label-width="120px">
            <div class="form-section">
              <h3>基本信息</h3>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="姓名" prop="name">
                    <el-input v-model="registrationForm.name" placeholder="请输入您的姓名" />
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="联系电话" prop="phone">
                    <el-input v-model="registrationForm.phone" placeholder="请输入联系电话" />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="邮箱地址" prop="email">
                    <el-input v-model="registrationForm.email" placeholder="请输入邮箱地址" />
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="职位" prop="position">
                    <el-input v-model="registrationForm.position" placeholder="请输入您的职位" />
                  </el-form-item>
                </el-col>
              </el-row>
            </div>

            <div class="form-section">
              <h3>公司信息</h3>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="公司名称" prop="company">
                    <el-input v-model="registrationForm.company" placeholder="请输入公司名称" />
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="所属行业" prop="industry">
                    <el-select v-model="registrationForm.industry" placeholder="请选择所属行业" style="width: 100%">
                      <el-option label="制造业" value="manufacturing" />
                      <el-option label="信息技术" value="it" />
                      <el-option label="研发机构" value="research" />
                      <el-option label="学术机构" value="academic" />
                      <el-option label="投资机构" value="investment" />
                      <el-option label="咨询服务" value="consulting" />
                      <el-option label="政府机构" value="government" />
                      <el-option label="其他" value="other" />
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="职务级别" prop="level">
                    <el-select v-model="registrationForm.level" placeholder="请选择职务级别" style="width: 100%">
                      <el-option label="高级管理层" value="senior_management" />
                      <el-option label="中层管理" value="middle_management" />
                      <el-option label="技术专家" value="technical_expert" />
                      <el-option label="研发人员" value="researcher" />
                      <el-option label="销售人员" value="sales" />
                      <el-option label="学者/教授" value="academic" />
                      <el-option label="学生" value="student" />
                      <el-option label="其他" value="other" />
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="工作年限" prop="experience">
                    <el-select v-model="registrationForm.experience" placeholder="请选择工作年限" style="width: 100%">
                      <el-option label="1年以下" value="below_1" />
                      <el-option label="1-3年" value="1_3" />
                      <el-option label="3-5年" value="3_5" />
                      <el-option label="5-10年" value="5_10" />
                      <el-option label="10年以上" value="above_10" />
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>

            <div class="form-section">
              <h3>参与信息</h3>
              <el-form-item label="参与目的" prop="purpose">
                <el-checkbox-group v-model="registrationForm.purpose">
                  <el-checkbox label="trend_insight">了解行业趋势</el-checkbox>
                  <el-checkbox label="technology_learning">技术学习</el-checkbox>
                  <el-checkbox label="networking">商务交流</el-checkbox>
                  <el-checkbox label="partnership">寻求合作</el-checkbox>
                  <el-checkbox label="investment">投资机会</el-checkbox>
                  <el-checkbox label="academic_research">学术研究</el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item label="关注议题" prop="interestedTopics">
                <el-select 
                  v-model="registrationForm.interestedTopics" 
                  multiple 
                  placeholder="请选择感兴趣的议题"
                  style="width: 100%"
                >
                  <el-option label="人工智能发展趋势" value="ai_trends" />
                  <el-option label="工业4.0与智能制造" value="industry4_smart" />
                  <el-option label="机器人技术创新" value="robotics_innovation" />
                  <el-option label="数字化转型" value="digital_transformation" />
                  <el-option label="可持续发展" value="sustainability" />
                  <el-option label="政策法规解读" value="policy_regulation" />
                  <el-option label="投资与并购" value="investment_ma" />
                  <el-option label="国际合作" value="international_cooperation" />
                </el-select>
              </el-form-item>
              <el-form-item label="期望收获" prop="expectations">
                <el-input
                  v-model="registrationForm.expectations"
                  type="textarea"
                  :rows="4"
                  placeholder="请描述您希望从本次论坛中获得什么收获"
                />
              </el-form-item>
              <el-form-item label="问题咨询" prop="questions">
                <el-input
                  v-model="registrationForm.questions"
                  type="textarea"
                  :rows="3"
                  placeholder="如果有机会，您希望向演讲嘉宾提出什么问题？"
                />
              </el-form-item>
            </div>

            <div class="form-section">
              <h3>特殊需求</h3>
              <el-form-item label="饮食要求" prop="dietaryRequirements">
                <el-checkbox-group v-model="registrationForm.dietaryRequirements">
                  <el-checkbox label="vegetarian">素食</el-checkbox>
                  <el-checkbox label="halal">清真</el-checkbox>
                  <el-checkbox label="no_spicy">不吃辣</el-checkbox>
                  <el-checkbox label="allergy">过敏（请在备注中说明）</el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item label="其他需求" prop="specialRequests">
                <el-input
                  v-model="registrationForm.specialRequests"
                  type="textarea"
                  :rows="3"
                  placeholder="请输入其他特殊需求（如无障碍设施、翻译服务等）"
                />
              </el-form-item>
            </div>

            <div class="form-section">
              <h3>确认信息</h3>
              <div class="registration-summary">
                <div class="summary-item">
                  <span>论坛名称：</span>
                  <span>{{ selectedForum?.title }}</span>
                </div>
                <div class="summary-item">
                  <span>论坛时间：</span>
                  <span>{{ selectedForum?.time }}</span>
                </div>
                <div class="summary-item">
                  <span>论坛地点：</span>
                  <span>{{ selectedForum?.location }}</span>
                </div>
                <div class="summary-item">
                  <span>论坛级别：</span>
                  <span class="level-tag">{{ selectedForum?.level }}</span>
                </div>
                <div class="summary-item">
                  <span>参与费用：</span>
                  <span class="free-tag">免费</span>
                </div>
              </div>
              <el-form-item prop="agreement">
                <el-checkbox v-model="registrationForm.agreement">
                  我已阅读并同意<a href="#" class="agreement-link">《论坛参与协议》</a>和<a href="#" class="agreement-link">《隐私政策》</a>
                </el-checkbox>
              </el-form-item>
              <el-form-item prop="materials">
                <el-checkbox v-model="registrationForm.materials">
                  我希望获取论坛相关资料和后续活动信息
                </el-checkbox>
              </el-form-item>
            </div>

            <div class="form-actions">
              <el-button size="large" @click="resetForm">重置表单</el-button>
              <el-button type="primary" size="large" @click="submitRegistration" :loading="submitting">
                确认报名
              </el-button>
            </div>
          </el-form>
        </div>
      </section>

      <!-- 其他论坛推荐 -->
      <section class="recommended-forums-section">
        <h2 class="section-title">其他论坛</h2>
        <div class="forums-grid">
          <div class="forum-card" v-for="forum in recommendedForums" :key="forum.id">
            <div class="forum-image">
              <img :src="forum.image" :alt="forum.title">
            </div>
            <div class="forum-info">
              <h4>{{ forum.title }}</h4>
              <p>{{ forum.time }}</p>
              <p>{{ forum.location }}</p>
              <el-button type="text" @click="selectForum(forum)">
                立即报名
              </el-button>
            </div>
          </div>
        </div>
      </section>
    </div>

    <!-- 成功对话框 -->
    <el-dialog v-model="successDialogVisible" title="报名成功" width="500px" center>
      <div class="success-content">
        <el-icon class="success-icon"><SuccessFilled /></el-icon>
        <h3>报名成功！</h3>
        <p>您已成功报名参加"{{ selectedForum?.title }}"</p>
        <div class="next-steps">
          <h4>接下来：</h4>
          <ul>
            <li>我们将在48小时内发送确认邮件</li>
            <li>论坛前会发送详细议程和资料</li>
            <li>现场将提供同声传译服务</li>
            <li>可与演讲嘉宾互动交流</li>
            <li>获得论坛结业证书</li>
          </ul>
        </div>
      </div>
      <template #footer>
        <el-button @click="successDialogVisible = false">关闭</el-button>
        <el-button type="primary" @click="$router.push('/activities')">返回活动中心</el-button>
      </template>
    </el-dialog>
  </div>
</template>

<script>
import { ref, reactive, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { 
  Clock, 
  Location, 
  User, 
  Tickets,
  SuccessFilled 
} from '@element-plus/icons-vue'

export default {
  name: 'ForumRegistration',
  setup() {
    const route = useRoute()
    const router = useRouter()
    
    const selectedForum = ref(null)
    const registrationFormRef = ref()
    const submitting = ref(false)
    const successDialogVisible = ref(false)

    // 报名表单
    const registrationForm = reactive({
      name: '',
      phone: '',
      email: '',
      position: '',
      company: '',
      industry: '',
      level: '',
      experience: '',
      purpose: [],
      interestedTopics: [],
      expectations: '',
      questions: '',
      dietaryRequirements: [],
      specialRequests: '',
      agreement: false,
      materials: false
    })

    // 表单验证规则
    const registrationRules = {
      name: [
        { required: true, message: '请输入姓名', trigger: 'blur' }
      ],
      phone: [
        { required: true, message: '请输入联系电话', trigger: 'blur' },
        { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
      ],
      email: [
        { required: true, message: '请输入邮箱地址', trigger: 'blur' },
        { type: 'email', message: '请输入正确的邮箱格式', trigger: 'blur' }
      ],
      position: [
        { required: true, message: '请输入职位', trigger: 'blur' }
      ],
      company: [
        { required: true, message: '请输入公司名称', trigger: 'blur' }
      ],
      industry: [
        { required: true, message: '请选择所属行业', trigger: 'change' }
      ],
      level: [
        { required: true, message: '请选择职务级别', trigger: 'change' }
      ],
      experience: [
        { required: true, message: '请选择工作年限', trigger: 'change' }
      ],
      purpose: [
        { type: 'array', required: true, message: '请选择参与目的', trigger: 'change' }
      ],
      agreement: [
        { validator: (rule, value, callback) => {
          if (!value) {
            callback(new Error('请同意论坛参与协议'))
          } else {
            callback()
          }
        }, trigger: 'change' }
      ]
    }

    // 模拟论坛数据
    const mockForums = {
      1: {
        id: 1,
        title: '2025人工智能与机器人技术发展高峰论坛',
        level: '高端论坛',
        description: '汇聚全球顶尖专家学者，深度探讨人工智能与机器人技术的发展趋势，分享最新研究成果和应用案例。',
        time: '2025年3月15日 14:00-17:30',
        location: '广州国际会展中心 国际会议厅',
        capacity: 500,
        registered: 387,
        image: 'https://images.unsplash.com/photo-1485827404703-89b55fcc595e?w=400&h=300&fit=crop',
        agenda: [
          {
            time: '14:00-14:30',
            topic: '开幕致辞及主题演讲',
            speaker: '中科院院士 李教授'
          },
          {
            time: '14:30-15:15',
            topic: '人工智能技术发展趋势与挑战',
            speaker: '清华大学 张教授'
          },
          {
            time: '15:15-16:00',
            topic: '机器人产业化应用与创新',
            speaker: '优必选科技 CEO'
          },
          {
            time: '16:00-16:15',
            topic: '茶歇交流',
            speaker: ''
          },
          {
            time: '16:15-17:00',
            topic: '圆桌讨论：AI+机器人的未来',
            speaker: '多位行业专家'
          },
          {
            time: '17:00-17:30',
            topic: '总结发言及闭幕',
            speaker: '论坛主席'
          }
        ],
        participants: ['李院士', '张教授', '王总工程师', '陈博士', '刘研究员']
      },
      2: {
        id: 2,
        title: '智能制造与工业4.0发展论坛',
        level: '专业论坛',
        description: '探讨智能制造技术发展现状，分享工业4.0实施经验，推动制造业数字化转型。',
        time: '2025年3月16日 09:00-12:00',
        location: '广州国际会展中心 会议室A',
        capacity: 300,
        registered: 245,
        image: 'https://images.unsplash.com/photo-1581094794329-c8112a89af12?w=400&h=300&fit=crop',
        agenda: [
          {
            time: '09:00-09:30',
            topic: '智能制造发展现状与趋势',
            speaker: '工信部专家'
          },
          {
            time: '09:30-10:15',
            topic: '工业4.0实施案例分享',
            speaker: '西门子中国 技术总监'
          },
          {
            time: '10:15-11:00',
            topic: '数字化转型最佳实践',
            speaker: 'GE数字集团 解决方案专家'
          },
          {
            time: '11:00-11:45',
            topic: '智能工厂建设经验分享',
            speaker: '海尔集团 智能制造总监'
          },
          {
            time: '11:45-12:00',
            topic: '互动问答环节',
            speaker: '全体嘉宾'
          }
        ],
        participants: ['工信部专家', '西门子技术总监', 'GE解决方案专家', '海尔智能制造总监']
      }
    }

    // 推荐论坛数据
    const recommendedForums = ref([
      {
        id: 2,
        title: '智能制造与工业4.0发展论坛',
        time: '2025年3月16日 09:00-12:00',
        location: '会议室A',
        image: 'https://images.unsplash.com/photo-1581094794329-c8112a89af12?w=300&h=200&fit=crop'
      }
    ])

    // 加载论坛信息
    const loadForum = () => {
      const forumId = route.query.id || route.query.forumId || '1'
      const forum = mockForums[forumId]
      if (forum) {
        selectedForum.value = forum
        // 过滤推荐论坛，排除当前论坛
        recommendedForums.value = recommendedForums.value.filter(
          item => item.id != forumId
        )
      } else {
        // 默认显示第一个论坛
        selectedForum.value = mockForums[1]
      }
    }

    // 选择论坛
    const selectForum = (forum) => {
      router.push(`/forum-registration?id=${forum.id}`)
    }

    // 重置表单
    const resetForm = () => {
      Object.assign(registrationForm, {
        name: '',
        phone: '',
        email: '',
        position: '',
        company: '',
        industry: '',
        level: '',
        experience: '',
        purpose: [],
        interestedTopics: [],
        expectations: '',
        questions: '',
        dietaryRequirements: [],
        specialRequests: '',
        agreement: false,
        materials: false
      })
      if (registrationFormRef.value) {
        registrationFormRef.value.resetFields()
      }
    }

    // 提交报名
    const submitRegistration = async () => {
      if (!registrationFormRef.value) return
      
      try {
        await registrationFormRef.value.validate()
        
        // 检查论坛容量
        if (selectedForum.value.registered >= selectedForum.value.capacity) {
          ElMessage.error('抱歉，该论坛报名人数已满')
          return
        }

        submitting.value = true
        
        // 调用真实的后端接口
        const response = await subpageApi.submitForumRegistration({
          forumId: selectedForum.value.id,
          forumName: selectedForum.value.title,
          ...registrationForm,
          registrationType: 'forum',
          submitTime: new Date().toISOString()
        })
        
        if (response && response.code === '200') {
          submitting.value = false
          successDialogVisible.value = true
          
          // 更新报名人数
          selectedForum.value.registered += 1
        } else {
          ElMessage.error(response?.msg || '论坛报名提交失败，请重试')
        }
        
      } catch (error) {
        console.error('论坛报名提交失败:', error)
        ElMessage.error(error.message || '论坛报名提交失败，请重试')
      } finally {
        submitting.value = false
      }
    }

    onMounted(() => {
      loadForum()
    })

    return {
      selectedForum,
      registrationForm,
      registrationRules,
      registrationFormRef,
      submitting,
      successDialogVisible,
      recommendedForums,
      selectForum,
      resetForm,
      submitRegistration
    }
  }
}
</script>

<style scoped>
.forum-registration {
  min-height: 100vh;
  background: linear-gradient(135deg, #320063 0%, #4a0a8a 100%);
  color: white;
}

.page-header {
  padding: 60px 0 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.breadcrumb {
  margin-bottom: 20px;
}

.breadcrumb :deep(.el-breadcrumb__inner) {
  color: white;
  cursor: pointer;
}

.breadcrumb :deep(.el-breadcrumb__inner:hover) {
  color: #ff6b35;
}

.page-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 10px;
  background: linear-gradient(45deg, #fff, #e0e0ff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 30px;
  text-align: center;
  color: white;
}

/* 论坛信息部分 */
.forum-info-section {
  padding: 40px 0;
}

.forum-card {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 30px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.forum-image {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}

.forum-image img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.forum-level-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #ff6b35;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}

.forum-details h2 {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 15px;
  color: white;
}

.forum-description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
  opacity: 0.9;
}

.forum-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.meta-item {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.meta-item .el-icon {
  margin-right: 8px;
  color: #ff6b35;
}

.forum-agenda,
.forum-participants {
  margin-bottom: 20px;
}

.forum-agenda h4,
.forum-participants h4 {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 15px;
  color: #ff6b35;
}

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-item {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.agenda-time {
  width: 100px;
  font-weight: bold;
  color: #ff6b35;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.agenda-content {
  flex: 1;
}

.agenda-content h5 {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.agenda-content p {
  font-size: 0.8rem;
  opacity: 0.8;
}

.participants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.participant-tag {
  background: rgba(255, 107, 53, 0.2);
  color: #ff6b35;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

/* 报名表单部分 */
.registration-form-section {
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.form-container {
  max-width: 800px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 40px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-section {
  margin-bottom: 40px;
}

.form-section h3 {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ff6b35;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 10px;
}

.registration-summary {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 1rem;
}

.summary-item:last-child {
  margin-bottom: 0;
}

.level-tag {
  background: #409eff;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
}

.free-tag {
  background: #67c23a;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
}

.agreement-link {
  color: #ff6b35;
  text-decoration: none;
}

.agreement-link:hover {
  text-decoration: underline;
}

.form-actions {
  text-align: center;
  margin-top: 30px;
}

.form-actions .el-button {
  margin: 0 10px;
  padding: 12px 30px;
  font-size: 1rem;
}

/* 推荐论坛部分 */
.recommended-forums-section {
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.forums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.recommended-forums-section .forum-card {
  display: block;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease;
}

.recommended-forums-section .forum-card:hover {
  transform: translateY(-5px);
}

.recommended-forums-section .forum-image {
  height: 150px;
}

.recommended-forums-section .forum-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.forum-info {
  padding: 20px;
}

.forum-info h4 {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.forum-info p {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 5px;
}

/* 成功对话框 */
.success-content {
  text-align: center;
  padding: 20px;
}

.success-icon {
  font-size: 4rem;
  color: #67c23a;
  margin-bottom: 20px;
}

.success-content h3 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 15px;
  color: #67c23a;
}

.success-content p {
  font-size: 1rem;
  margin-bottom: 20px;
  opacity: 0.9;
}

.next-steps {
  text-align: left;
  background: rgba(103, 194, 58, 0.1);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid rgba(103, 194, 58, 0.3);
}

.next-steps h4 {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: #67c23a;
}

.next-steps ul {
  list-style: none;
  padding: 0;
}

.next-steps li {
  padding: 5px 0;
  padding-left: 20px;
  position: relative;
}

.next-steps li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #67c23a;
  font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .forum-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .forum-meta {
    grid-template-columns: 1fr;
  }
  
  .agenda-item {
    flex-direction: column;
  }
  
  .agenda-time {
    width: auto;
    margin-bottom: 8px;
  }
  
  .form-container {
    padding: 20px;
  }
  
  .page-title {
    font-size: 2rem;
  }
}

/* Element Plus 组件样式覆盖 */
.forum-registration :deep(.el-form-item__label) {
  color: white !important;
  font-weight: 500;
}

.forum-registration :deep(.el-input__wrapper) {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: white !important;
}

.forum-registration :deep(.el-input__inner) {
  color: white !important;
}

.forum-registration :deep(.el-select .el-input__wrapper) {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.forum-registration :deep(.el-textarea__inner) {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: white !important;
}

.forum-registration :deep(.el-checkbox__label) {
  color: white !important;
}

.forum-registration :deep(.el-checkbox__input.is-checked .el-checkbox__inner) {
  background-color: #ff6b35 !important;
  border-color: #ff6b35 !important;
}

.forum-registration :deep(.el-checkbox__inner:hover) {
  border-color: #ff6b35 !important;
}
</style>
